﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Windows.Controls;
using System.Windows;
using System.Windows.Media;


namespace Listas
{
    public class Labels : CommomFunctions.Labels
    {
        /// <summary>
        /// Maximum number of Labels that will be drawn.
        /// </summary>
        private int numElem = 8;

        public int numElements
        {
            get { return this.numElem; }
        }

        /// <summary>
        /// Creates the Labels that will be the nodes of the List.
        /// The Label at index 0 represents the node that is animated (the Label that comes and goes from the memory)
        /// The last Label represents the Null image as the last node in the List always points to Null.
        /// Thus, the number of nodes in the List is numElements - 2
        /// </summary>
        public void createElements(Grid Gridi)
        {
            for (int i = 0; i < numElements; i++)
            {
                Label tempLabel = new Label();
                Gridi.Children.Add(tempLabel);
                labels.Add(tempLabel);
            }

            foreach (Label lbl in labels)
            {
                lbl.Margin = new Thickness(19 + (117 * labels.IndexOf(lbl)), 0, 890 - (117 * labels.IndexOf(lbl)), 40.0);
                lbl.Height = 56;
                lbl.Visibility = Visibility.Hidden;
                lbl.VerticalAlignment = VerticalAlignment.Bottom;
                lbl.HorizontalAlignment = HorizontalAlignment.Stretch;
                lbl.Foreground = Brushes.LemonChiffon;
                lbl.BorderBrush = Brushes.DarkSeaGreen;
                lbl.BorderThickness = new Thickness(2);
                lbl.Background = Brushes.ForestGreen;
                lbl.HorizontalContentAlignment = HorizontalAlignment.Center;
                lbl.VerticalContentAlignment = VerticalAlignment.Center;

                lbl.FontSize = 30;
                lbl.FontWeight = FontWeights.Bold;
                
                Grid.SetRow(lbl, 1);
                Grid.SetRowSpan(lbl, 2);
                Grid.SetColumnSpan(lbl, 9);
            }

            Grid.SetRow((Label)labels[0], 0);
            Grid.SetRowSpan((Label)labels[0], 3);

        }
    }
}
